package org.chen.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("comment_rule")
public class CommentRule extends Model<CommentRule> {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("url_pattern")
    private String urlPattern;

    @TableField("form_selector")
    private String formSelector;

    @TableField("action_url")
    private String actionUrl;

    @TableField("comment_field")
    private String commentField;

    @TableField("author_field")
    private String authorField;

    @TableField("email_field")
    private String emailField;

    @TableField("url_field")
    private String urlField;

    @TableField("hidden_fields")
    private String hiddenFields;  // JSON字符串存储隐藏字段

    @TableField("hidden_field_names")
    private String hiddenFieldNames;  // 只保存隐藏字段的名称列表，JSON格式

    @TableField("use_count")
    private Integer useCount;

    @TableField(value = "last_used_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime lastUsedTime;

    @TableField("success_rate")
    private Double successRate;
}